package controllers;

import play.*;
import play.mvc.*;

import java.util.*;

import models.*;

public class Application extends Controller {

    @Before(unless = {"loginPage","registerPage"})
    static void checkLogin(){
        renderArgs.put("cxt",request.host);
        if(session.get("user")!=null){
            renderArgs.put("user",User.findById(session.get("user")));
        }
    }
    public static void index() {
        render("Application/home.html");
    }
    public static void film(){
        render("Application/film.html");
    }
    public static void filmDetail(){
        render("Application/filmDetail.html");
    }
    public static void theatre(){
        render("Application/theatre.html");
    }
    public static void seatOrder(){
        render("Application/seatOrder.html");
    }
    public static void theatreDetail(){
        render("Application/theatreDetail.html");
    }

    public static void notFound(){
        render("Application/errors/404.html");
    }

}